﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EFong.Contract;

namespace EFong.BL
{
    [Serializable]
    public class BusinessException : Exception
    {
        public int Type
        {
            get;
            set;
        }

        private List<FailValue> failValues = new List<FailValue>();
        public List<FailValue> FailValues
        {
            get { return failValues; }
            set { failValues = value; }
        }

        public BusinessException(string message) : base(message) { }
        public BusinessException() : base() { }
        public BusinessException(Enum _enum)
            : base(_enum.ToString())
        {
            this.Type = _enum.GetHashCode();
        }

        public BusinessException(Enum _enum, params FailValue[] failValueList)
            : this(_enum)
        {
            failValues.AddRange(failValueList);
        }
    }
}
